<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Insert title here</title>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/index_right.css?v=2012">
</head>

<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
	$
	(

			
		function()
		{
			var text_length = 30;
			var goods_text = $("#art_text").text().length;
			if (goods_text > text_length)
			{
				$("#art_text").text($("#art_text").text().substring(0, text_length) + "...");
			}
		}
	);
</script>

<body>
	<div class="in_r_div1">
		<div class="in_r_div2">
			<form action="${pageContext.request.contextPath}/IndexServlet">
				物品类型： 
				<select name = "selectType">
					<option value="">全部</option>
					<option value="0001">护肤</option>
					<option value="0002">彩妆</option>
					<option value="0003">香氛</option>
					<option value="0004">身体护理</option>
					<option value="0005">礼盒套装</option>
					<option value="0006">母婴专区</option>
					<option value="0007">男士专区</option>
					<option value="0008">粉底</option>
					<option value="0009">粉饼</option>
					<option value="00010">睫毛膏</option>
					<option value="00011">唇彩</option>
					<option value="00012">腮红</option>
				</select>
				<input type="text" class="in_r_input1" name="search"> 
				<input type="submit" value="搜索"> 
			</form>
		</div>
		
		<div class="in_r_div3">
		</div>
		
		<div class="in_r_div4">
			<table>
				<tr>
					<c:forEach var = "li" items="${list}" varStatus="status">
						<td class="in_td">
							<a href="${pageContext.request.contextPath}/Article_InfoServlet?article_id=${li.id}">
								<img alt="找不到图片" src="/ShoppingWebsite/images/article/${li.image}">
							</a>
							<br>
							<span class="in_r_sp1">￥:${li.price}</span>
							<span class="in_r_sp2">￥:
								<fmt:formatNumber type="number" value="${li.price * li.discount}" pattern="0.00" maxFractionDigits="2">
								</fmt:formatNumber>
							</span>
							<br>
							<a href="${pageContext.request.contextPath}/Article_InfoServlet?article_id=${li.id}" class="in_r_a" id="art_text">${li.title}</a></td>

						<!-- 处理一行显示几个图片 -->

						<c:if test="${status.count%4==0 }">
							<tr>
						</c:if>
					</c:forEach>
				</tr>
			</table>
		</div>
	</div>
	

</body>
</html>